﻿@model IEnumerable<TGBTech.Core.Models.DanhMuc.DanhMuc>

@{
    ViewBag.Title = "Danh mục";
}

<div class="row">
    <div class="col-md-12">
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box blue">
            <div class="portlet-title">
                <div class="caption">Danh mục</div>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                    <a href="javascript:;" class="reload"></a>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-toolbar">
                    <a class="btn green" data-toggle="modal" href="#createDanhMuc">Thêm mới</a>
                </div>
                <table class="table table-striped table-bordered table-hover" id="tableDanhMuc">
                    <thead>
                        <tr>
                            <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#tableDanhMuc .checkboxes" /></th>
                            <th><b>Tên danh mục</b></th>
                            <th><b>Loại</b></th>
                            <th></th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr class="odd gradeX">
                                <td><input type="checkbox" class="checkboxes" value="1" /></td>
                                <td>@item.Name</td>
                                <td>@item.Type</td>
                                <td><a data-toggle="modal" class="btnEditDanhMuc" id="@item.Id" href="#editDanhMuc">Sửa</a></td>
                                <td><a data-toggle="modal" class="btnDeleteDanhMuc" id="@item.Id" href="#editDanhMuc">Xóa</a></td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
</div>

<div class="modal fade" id="createDanhMuc" tabindex="-1" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-body" data-url=@Html.Action("Create")</div>
    </div>
</div>

<div class="modal fade" id="editDanhMuc" tabindex="-1" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-body" id="bodyEditDanhMuc"</div>
    </div>
</div>